#ifndef SPI_SOFTWARE_H
#define SPI_SOFTWARE_H

#include "stm32f4xx_gpio.h"
#define RCC_AHB1Periph_GPIOx(GPIOX)  ((uint32_t)0x00000001)<<( GPIOX - GPIOA )/0x19

   
    typedef struct SPI_line
    {
      GPIO_TypeDef * GPIOx;
      uint16_t GPIO_Pin;

    }SPI_line;

   typedef struct SPI_software
   {
      SPI_line SCL;
      SPI_line MOSI;
      SPI_line MISO;
      SPI_line CS;
   }SPI_software;
   


   void SPI_software_init(SPI_software SPI_softwarex);
   void SPI_software_only_write(SPI_software SPI_softwarex,unsigned char CPHA,unsigned char CPOL,unsigned char data_8bit);
   unsigned char SPI_software_only_read(SPI_software SPI_softwarex,unsigned char CPHA,unsigned char CPOL);
#endif // SPI_SOFTWARE_H